<template>
	<view>
		<scroll-view :scroll-y="modalName==null" class="page" :class="show">
			<cu-custom bgColor="bg-gradual-pink" :isBack="true">
				<block slot="backText">返回</block>
				<block slot="content">视频列表</block>
			</cu-custom>
			<view class="cu-list menu" v-for="(item) in videoList" :class="[menuBorder?'sm-border':'',menuCard?'card-menu margin-top':'']">
				<view class="cu-item"  @click="toVideo(item.vod_id)" :class="menuArrow?'arrow':''">
					<view class="content" hover-class="none" >
						<text class="cuIcon-discoverfill text-orange"></text>
						<text class="text-grey">{{item.vod_name}}</text>
					</view>
				</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				modalName: null,
				gridCol: 3,
				gridBorder: false,
				menuBorder: false,
				menuArrow: false,
				menuCard: false,
				skin: false,
				listTouchStart: 0,
				listTouchDirection: null,
				videoList:[]
			};
		},
		methods: {
			getVideo:function(data){
				console.log(data);
				var that = this;
				that.http.sendRequest("/query/list/"+data.type_id,'get',{},{
					"Content-Type":"application/json;charset=UTF-8"
				}).then(function(res){
					if(res.code==0){
						console.log(res.data);
						that.videoList=that.videoList.concat(res.data);
						//that.subjects=that.subjects.concat(JSON.parse(res.data));
					}
				})
			},
			toVideo:function(data){
				console.log(data);
				uni.navigateTo({
					url:"info?data="+data
				})
				/* 
				var that = this;
				that.http.sendRequest("/video/"+data,'get',{},{
					"Content-Type":"application/json;charset=UTF-8"
				}).then(function(res){
					if(res.code==0){
						console.log(res.data);
						uni.navigateTo({
							url:"info?data="+res.data
						})
						//that.subjects=that.subjects.concat(JSON.parse(res.data));
					}
				}) */
			}
		},
		onLoad(res){
			console.log(res);
			this.getVideo(res);
		}
	}
</script>

<style>
	.page {
		height: 100Vh;
		width: 100vw;
	}

	.page.show {
		overflow: hidden;
	}

	.switch-sex::after {
		content: "\e716";
	}

	.switch-sex::before {
		content: "\e7a9";
	}

	.switch-music::after {
		content: "\e66a";
	}

	.switch-music::before {
		content: "\e6db";
	}
</style>